<?php

class Core_Controller_Browse_Language_Select extends Nuo_Controller
{
	function execute($request)
	{

		$id = $request -> getParam('lang_id');

		if ($id)
		{
			$uri = Nuo::getUrl();

			Nuo::redirect($uri);
		}

		$table = Nuo::getTable('core/language');

		$select = $table -> select()->order('title');

		$items = $table -> fetchAll($select);

		return  Nuo::getView()->render('core/layout/master/fbox', array(
			'content' => $this -> render(array('items' => $items)),
			'title' => 'Select language.'
		));
	}

}
